/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef GEN_OBJECT_PCIeNicCard_NETWORK_PORT_H
#define GEN_OBJECT_PCIeNicCard_NETWORK_PORT_H

#include <device_tree/base.h>
#include <device_tree/interface/NetworkPort.h>
#include <device_tree/interface/NetworkPort/DataCenterBridging.h>
#include <device_tree/interface/NetworkPort/LLDPReceive.h>
#include <device_tree/interface/NetworkPort/LinkInfo.h>
#include <device_tree/interface/NetworkPort/Metrics.h>
#include <device_tree/interface/OpticalModule.h>

namespace dev::gen {

/**
 * @brief 网络端口驱动类
 *
 * 实现网络端口的驱动功能，作为PCIeNicCard的子设备
 */
class MC_API network_port : public mc::engine::object<network_port> {
public:
    MC_OBJECT(
        network_port, "NetworkPort", "${Parent}/NetworkPort/${Id}",
        (NetworkPort)(NetworkPort_LinkInfo)(NetworkPort_DataCenterBridging)(NetworkPort_LLDPReceive)(NetworkPort_Metrics))

    virtual bool init(const mc::dict& config) = 0;
    virtual bool start()                      = 0;
    virtual bool stop()                       = 0;

    NetworkPort                    m_network_port;
    NetworkPort_LinkInfo           m_network_port_link_info;
    NetworkPort_DataCenterBridging m_network_port_data_center_bridging;
    NetworkPort_LLDPReceive        m_network_port_lldp_receive;
    NetworkPort_Metrics            m_network_port_metrics;
};

} // namespace dev::gen

#endif // GEN_OBJECT_PCIeNicCard_NETWORK_PORT_H